<template>
    <div class="detail">
        <meta name="referrer" content="no-referrer"/>
        <el-row>
            <el-col :span="10" :offset="2">
                <h1>6</h1>
                <span>
                    <img src="https://img9.doubanio.com/view/photo/s_ratio_poster/public/p529908155.jpg" height="250px"
                         :alt="6">
                </span>
            </el-col>
        </el-row>
    </div>
</template>

<script>
    export default {
        name: "MovieMessage",
        data() {
            return {
                movie_id: 0,
                movie_info: ''
            }
        },
        created() {
            this.get_movie_id();
            this.get_movie_data()
        },
        methods: {
            get_movie_id() {
                this.movie_id = this.$route.params.pk || this.$route.query.pk;
                if (this.movie_id < 6) {
                    let _this = this;
                    _this.$alert("对不起，电影不存在！", "警告", {
                        callback() {
                            _this.$router.go(-1);
                        }
                    });
                }
            },

            get_movie_data() {
                this.$axios.get(`${this.$settings.base_url}/yingshi/movie/${this.movie_id}/`).then(response => {
                    this.movie_info = response.data;
                    console.log(this.movie_info)
                }).catch(() => {
                    this.$message({
                        message: "对不起，访问页面出错！请联系客服工作人员！"
                    });
                })
            }
        }
    }
</script>

<style scoped>
    .detail {
        margin-top: 50px;
    }
</style>